Remove need for glXGetProcAddressARB
authorMichal Klocek <michal.klocek@qt.io>
Mon, 12 Nov 2018 12:17:40 +0000 (13:17 +0100)
committerDmitry Shachnev <mitya57@debian.org>
Thu, 15 Aug 2019 14:15:39 +0000 (15:15 +0100)
We do already require glXGetProcAddress in line 248.

Task-number: QTBUG-71488
Change-Id: Id0f3bc256a71097241b99d2dcba927c1165e980e

Gbp-Pq: Name remove_need_for_glXGetProcAddressARB.patch

src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp

index 741885e32191aac9114741669506b318bee9ab40..571b6866133623c5065a2a7a29a0a00f7df99c74 100644 (file)
@@ -626,43 +626,7 @@ void QGLXContext::swapBuffers(QPlatformSurface *surface)
 
 QFunctionPointer QGLXContext::getProcAddress(const char *procName)
 {
-#ifdef QT_STATIC
-    return glXGetProcAddressARB(reinterpret_cast<const GLubyte *>(procName));
-#else
-    typedef void *(*qt_glXGetProcAddressARB)(const GLubyte *);
-    static qt_glXGetProcAddressARB glXGetProcAddressARB = 0;
-    static bool resolved = false;
-
-    if (resolved && !glXGetProcAddressARB)
-        return 0;
-    if (!glXGetProcAddressARB) {
-        QList<QByteArray> glxExt = QByteArray(glXGetClientString(m_display, GLX_EXTENSIONS)).split(' ');
-        if (glxExt.contains("GLX_ARB_get_proc_address")) {
-#if QT_CONFIG(dlopen)
-            void *handle = dlopen(NULL, RTLD_LAZY);
-            if (handle) {
-                glXGetProcAddressARB = (qt_glXGetProcAddressARB) dlsym(handle, "glXGetProcAddressARB");
-                dlclose(handle);
-            }
-            if (!glXGetProcAddressARB)
-#endif
-            {
-#if QT_CONFIG(library)
-                extern const QString qt_gl_library_name();
-//                QLibrary lib(qt_gl_library_name());
-                QLibrary lib(QLatin1String("GL"));
-                if (!lib.load())
-                    lib.setFileNameAndVersion(QLatin1String("GL"), 1);
-                glXGetProcAddressARB = (qt_glXGetProcAddressARB) lib.resolve("glXGetProcAddressARB");
-#endif
-            }
-        }
-        resolved = true;
-    }
-    if (!glXGetProcAddressARB)
-        return 0;
-    return (void (*)())glXGetProcAddressARB(reinterpret_cast<const GLubyte *>(procName));
-#endif
+    return glXGetProcAddress(reinterpret_cast<const GLubyte *>(procName));
 }
 
 QSurfaceFormat QGLXContext::format() const